package com.dfbz.demo03_局部内部类;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01 {
    public static void main(String[] args) {

        Person person = new Person();
        person.eat();
    }
}

class Person {
    private String name = "小灰";


    public void eat() {
        class Chopsticks {
            private int length;

            public Chopsticks(int length) {
                this.length = length;
            }

            public void use() {
                System.out.println("【" + name + "】正在使用长度为【" + length + "】的筷子吃饭");
            }
        }

        Chopsticks chopsticks=new Chopsticks(180);

        chopsticks.use();

    }
}